home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / sysid47.arc / SYSID.PAS < prev   
Pascal/Delphi Source File  |  1989-12-17  |  6KB  |  231 lines

  1. (*
  2. **    SYSID.PAS
  3. **
  4. **    Version 4.7
  5. **
  6. **    Usage:    [d:][path]SYSID
  7. **
  8. **    A system description for DOS-based PC/XT/AT- and PS/2-class machines.
  9. **    SYSID generates 16 screens of information about the host system and runs
  10. **    under DOS versions 3.0 and later.
  11. **
  12. **    My primary sources of ideas in SYSID were Ray Duncan's "Advanced MS-DOS
  13. **    Programming," Terry Dettman's "DOS Programmer's Reference," and the
  14. **    "ms.dos/secrets" conference on BIX.  Bob Smith's article "Chips in
  15. **    Transition", PC Tech Journal 4 : 4, p. 56, and Prakash Chandra's article
  16. **    "?", Byte 13 : ? p. ? were valuable references.  The ideas of Terje
  17. **    Mathisen, Barry Nance, and others also appear in various places.  Mike
  18. **    Sargent and Redmond Simonsen contributed valuable feedback during the
  19. **    development of SYSID.
  20. **
  21. **    Some of the techniques SYSID uses are not documented or officially
  22. **    supported by either IBM or Microsoft.  Where possible I have followed the
  23. **    undocumented routine with a comment describing my source for the
  24. **    technique.  If such a technique is not commented, the source was most
  25. **    likely the Dettman book.
  26. **
  27. **    SYSID was developed on an IBM PC with Turbo Pascal 5.0, Turbo Assembler
  28. **    1.0, and DOS 3.30.  The source code has been split into three files:
  29. **
  30. **        SYSID.PAS    - this file
  31. **        SYSID.INC    - Pascal functions and procedures
  32. **        SYSID.ASM    - assembly language functions and procedures
  33. **
  34. **    Known bugs:
  35. **        1)    Page 2:  The CPU test for interrupts of multi-prefix string
  36. **            instructions is reliable only on machines whose clock speeds are
  37. **            less than about 15 MHz.  The 8086 and 8088 are the only CPU's that
  38. **            don't handle such interrupts correctly, however, and they aren't
  39. **            (to my knowledge) ever run at anything like 15 MHz.  (This 15 MHz
  40. **            limit assumes that the timer tick interrupt occurs at the standard
  41. **            rate of 18.2 Hz.  SYSID could check that, too, I suppose.)
  42. **        2)    Page 5:  The description of foreground color will not mention the
  43. **            blinking attribute, even if it was enabled before you invoked
  44. **            SYSID.
  45. **        3)    Page 10:  SYSID used to report incorrectly the statuses of some of
  46. **            the executable files which use the "multiplex interrupt" (INT
  47. **            2FH).  I have commented these status checks out of the source
  48. **            code, determined to do battle with them another day.  Can anyone
  49. **            supply the correct INT 2FH functions for these files?  Or are some
  50. **            of them red herrings that simply check INT 2FH to see if *other*
  51. **            files have been loaded (e.g. APPEND/ASSIGN)?
  52. **        4)    The error beep sometimes fails to sound when you press the first
  53. **            erroneous key (e.g. PgDn while on the last page.  It appears to
  54. **            work correctly for the second and subsequent erroneous keys.  I
  55. **            have no idea why.
  56. **        5)    Not all BIOSes and OEM versions of DOS operate precisely the same
  57. **            way their IBM counterparts do.  If not everything in your system
  58. **            is true-Blue, SYSID's report may not be exactly what you expect.
  59. **
  60. **    SYSID is copyright 1989 by Steve Grant.  All rights reserved.  Neither the
  61. **    source code nor the object code of SYSID carries any warranty, either
  62. **    express or implied, of merchantability or of fitness for a particular
  63. **    purpose.  Comments, suggestions, and questions may be addressed to:
  64. **        BIXMail: sjgrant
  65. **        CompuServe: 71101,706
  66. **
  67. **    Steve Grant
  68. **    Long Beach, CA
  69. **    July 31, 1989
  70. *)
  71.  
  72. (*$A-*)
  73. (*$B-*)
  74. (*$D+*)
  75. (*$F-*)
  76. (*$I-*)
  77. (*$M 16384, 0, 655360*)
  78. (*$N-*)
  79. (*$O-*)
  80. (*$R-*)
  81. (*$S-*)
  82. (*$V-*)
  83.  
  84. program SYSID;
  85.  
  86. uses
  87.     crt,
  88.     dos,
  89.     graph;
  90.  
  91. const
  92.     notice = 'Copyright 1989 by Steve Grant';
  93.  
  94. const
  95.     BIOSdseg = $0040;
  96.     pgmax = 16;
  97.     pchar = [' '..'~'];
  98.     secsiz = 512;
  99.     tick1 = 1193180;
  100.  
  101. type
  102.     cpu_info_t = record
  103.         cpu_type : byte;
  104.         MSW : word;
  105.         GDT : array[1..6] of byte;
  106.         IDT : array[1..6] of byte;
  107.         opsize : boolean;
  108.         chkint : boolean;
  109.         mult : boolean;
  110.         ndp_type : byte;
  111.         ndp_cw : word
  112.     end;
  113.  
  114. var
  115.     attrsave : byte;
  116.     ccode : word;
  117.     country : array[0..33] of byte;
  118.     currdrv : byte;
  119.     devofs : word;
  120.     devseg : word;
  121.     dirsep : set of char;
  122.     DOScofs : word;
  123.     DOScseg : word;
  124.     DOSmem : longint;
  125.     equip : word;
  126.     graphdriver : integer;
  127.     i : word;
  128.     intvec : array[$00..$FF] of pointer;
  129.     osmajor : byte;
  130.     osminor : byte;
  131.     pg : 1..pgmax;
  132.     regs : registers;
  133.     switchar : char;
  134.     tlength : byte;
  135.     twidth : byte;
  136.     vidpg : byte;
  137.     x1 : byte;
  138.     x2 : byte;
  139.     xbool1 : boolean;
  140.     xbool2 : boolean;
  141.     xchar1 : char;
  142.     xchar2 : char;
  143.     xword : word;
  144.  
  145. (*$L SYSID *)
  146.  
  147. (*$I SYSID.INC *)
  148.  
  149. begin
  150.     xword := dosversion;
  151.     osmajor := lo(xword);
  152.     osminor := hi(xword);
  153.     if osmajor = 3 then begin
  154.         init;
  155.         xbool1 := false;
  156.         repeat
  157.             gotoxy(x1, tlength);
  158.             textcolor(lightgray);
  159.             write(pg : 2);
  160.             window(1, 3, twidth, tlength - 2);
  161.             clrscr;
  162.             case pg of
  163.                 1 : page_01;
  164.                 2 : page_02;
  165.                 3 : page_03;
  166.                 4 : page_04;
  167.                 5 : page_05;
  168.                 6 : page_06;
  169.                 7 : page_07;
  170.                 8 : page_08;
  171.                 9 : page_09;
  172.                 10 : page_10;
  173.                 11 : page_11;
  174.                 12 : page_12;
  175.                 13 : page_13;
  176.                 14 : page_14;
  177.                 15 : page_15;
  178.                 16 : page_16
  179.             end;
  180.             window(1, 1, twidth, tlength);
  181.             gotoxy(x2, tlength);
  182.             xbool2 := false;
  183.             repeat
  184.                 repeat
  185.                 until keypressed;
  186.                 xchar1 := readkey;
  187.                 if keypressed then
  188.                     xchar2 := readkey
  189.                 else
  190.                     xchar2 := #0;
  191.                 if (xchar1 = #27) and (xchar2 = #0) then begin
  192.                     xbool2 := true;
  193.                     xbool1 := true
  194.                 end else if (xchar1 = #0) and (xchar2 = #71) and (pg > 1) then
  195.                     begin
  196.                     xbool2 := true;
  197.                     pg := 1
  198.                 end else if (xchar1 = #0) and (xchar2 = #73) and (pg > 1) then
  199.                     begin
  200.                     xbool2 := true;
  201.                     dec(pg)
  202.                 end else if (xchar1 = #0) and (xchar2 = #79) and (pg < pgmax)
  203.                     then begin
  204.                     xbool2 := true;
  205.                     pg := pgmax
  206.                 end else if (xchar1 = #0) and (xchar2 = #81) and (pg < pgmax)
  207.                     then begin
  208.                     xbool2 := true;
  209.                     inc(pg)
  210.                 end else begin
  211.                     sound(220);
  212.                     delay(100);
  213.                     nosound
  214.                 end
  215.             until xbool2
  216.         until xbool1;
  217.         textattr := attrsave;
  218.         clrscr
  219.     end else begin
  220.         writeln;
  221.         writeln('SYSID requires DOS version 3.x');
  222.         write('Your DOS version is ');
  223.         if osmajor > 0 then begin
  224.             write(osmajor, '.');
  225.             zeropad(osminor);
  226.             writeln
  227.         end else
  228.             writeln('1.x')
  229.     end
  230. end.
  231.